﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SecurityApi.Business
{
    public class EnterpriseManager
    {
        public IQueryable<SecurityApi.Model.Enterprise> GetAllEnterprises()
        {
            SecurityApi.DataAccess.EnterpriseRepository repository = new SecurityApi.DataAccess.EnterpriseRepository();
            IQueryable<SecurityApi.Model.Enterprise> apps = repository.GetAllEnterprises();
            return apps;
        }

        public SecurityApi.Model.Enterprise GetEnterpriseById(int enterpriseId)
        {
            SecurityApi.DataAccess.EnterpriseRepository repository = new SecurityApi.DataAccess.EnterpriseRepository();
            return repository.GetEnterpriseById(enterpriseId);
        }

        public SecurityApi.Model.Enterprise GetEnterpriseByName(string enterpriseName)
        {
            enterpriseName = enterpriseName.Trim();
            SecurityApi.DataAccess.EnterpriseRepository repository = new SecurityApi.DataAccess.EnterpriseRepository();
            return repository.GetEnterpriseByName(enterpriseName);
        }

    }
}
